<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="ThemeBucket">
    <link rel="shortcut icon" href="#" type="image/png">

    <title>Basic Table</title>

    <!--导入: common-->
    <div th:include="~{common/component :: commone-css}"></div>

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <div th:include="common/component :: brosupport-js"></div>
    <![endif]-->
</head>

<body class="sticky-header">
    <section>
        <!-- left side start-->
        <div th:include="~{common/component::leftSide}"></div>
        <!-- 左侧结束-->

        <!-- main content start-->
        <div class="main-content">

            <!-- 头部分开始-->
            <div th:include="~{common/component::headerSection}"></div>
            <!-- 头部分结束-->

            <!--内容区域开始-->
            <div class="wrapper">
                <div class="row">
                    <div class="col-sm-12">
                        <section class="panel">
                            <header class="panel-heading">
                                用户列表
                                <a href="#myModal" data-toggle="modal" class="btn btn-xs btn-info" style="margin-left: 30px;">新增用户</a>
                                <span class="tools pull-right">
                                    <a href="javascript:;" class="fa fa-chevron-down"></a>
                                    <a href="javascript:;" class="fa fa-times"></a>
                                </span>
                            </header>
                            <div class="panel-body">
                                <table class="table  table-hover general-table">
                                    <thead>
                                        <tr>
                                            <th>序号</th>
                                            <th>姓名</th>
                                            <th>年龄</th>
                                            <th>邮箱</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <!--/*@thymesVar id="userList" type="com.hrbu.springboot04.bean.User"*/-->
                                        <tr th:each="user,iterStat:${userList}">
                                            <td th:text="${iterStat.count}">count</td>
                                            <td th:text="${user.name}"></td>
                                            <td th:text="${user.age}"></td>
                                            <td th:text="${user.email}"></td>
                                            <td>
                                                <a th:href="@{/edit(id=${user.id})}" class="label label-warning label-mini">修改</a>
                                                <a th:href="@{/del(id=${user.id})}"  class="label label-danger label-mini">删除</a>
                                            </td>
                                        </tr>

                                    </tbody>
                                </table>
                            </div>
                        </section>
                    </div>
                </div>
                <div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
                                <h4 class="modal-title">Form Tittle</h4>
                            </div>
                            <div class="modal-body">

                                <form role="form" th:action="@{/add}" method="post">
                                    <div class="form-group">
                                        <label for="name">姓名</label>
                                        <input type="text" name="name" class="form-control" id="name" placeholder="填入姓名">
                                    </div>
                                    <div class="form-group">
                                        <label for="age">年龄</label>
                                        <input type="number" name="age" class="form-control" id="age" placeholder="填入年龄">
                                    </div>
                                    <div class="form-group">
                                        <label for="email">邮箱</label>
                                        <input type="email" name="email" class="form-control"  placeholder="填入邮箱" id="email">
                                    </div>
                                    <p class="help-block">just right to submit!</p>
                                    <button type="submit" class="btn btn-primary">立即提交</button>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--内容区域结束-->

            <!--footer  start-->
            <footer>2014 &copy; AdminEx by ThemeBucket</footer>
            <!--footer  end--> </div>
        <!-- main content end--> </section>

</body>
<!-- Placed js at the end of the document so the pages load faster -->
<div th:include="~{common/component :: jquery-js}"></div>
<!--easy pie chart-->
<div th:include="~{common/component :: pieChart-js}"></div>
<!--Sparkline Chart-->
<div th:include="~{common/component :: sparkChart-js}"></div>
<!--icheck -->
<div th:include="~{common/component :: icheck-js}"></div>
<!-- jQuery Flot Chart-->
<div th:include="~{common/component :: jqeryFlot-js}"></div>
<!--common scripts for all pages-->
<script src="js/scripts.js"></script>
<script>
    /*function del(id){
        $.get("del?id="+id,function (data){
            console.log(123);
        })
    }*/
</script>
</html>